#include "Parabola.h"


Parabola::Parabola()
{
	focus = 1.0;
	yOffset = -1.0;
	xOffset = 0;
}

Parabola::Parabola(double foc)
{
	focus = foc;
	yOffset = -focus;
	xOffset = 0;
}

Parabola::Parabola(double foc, double yOff, double xOff)
{
	focus = foc;
	yOffset = yOff;
	xOffset = xOff;
}

bool Parabola::pointInside(double *position, double error)
{
	if(position[1] > (1/(4.0*focus))*(position[0]-xOffset)*(position[0]-xOffset) + yOffset)
	{
		if(focus > 0)
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	else
	{
		if(focus > 0)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}